Skip to main content

com.homemade.pattern.singleton

info

Version: 1.0.0
Github: Link

This is simple package for singleton, can use in any project.

1. Import

Download from my registries

  • Open Package Manager in Unity.
  • Select Packages tab: My Registries.
  • Download package: com.homemade.pattern.singleton

Follow the setup: Click here.

Import from github

Follow this guide: Click here.

2. How to use

using com.homemade.pattern.singleton;

3. Example

using com.homemade.pattern.singleton;

public class GameManager : MonoSingleton<GameManager>
{
private void Start()
{

}
}

4. Explain

  • This singleton will automatic create an instance if it's not exist on scene.
  • You don't need to attach the script to a GameObject, you can just call the class.

You can see the source code for more understand